package com.javaweb.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.javaweb.admin.entity.C37InfCkScBillNew;
import com.javaweb.admin.entity.KDLCustomer;
import com.javaweb.admin.entity.KDLCustomerLog;
import com.javaweb.admin.query.C37InfCkScBillNewQuery;
import com.javaweb.admin.query.KDLCustomerQuery;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface KDLCustomerMapper extends BaseMapper<KDLCustomer> {
    IPage<KDLCustomer> getCustomerList(IPage<KDLCustomer> page, @Param("req") KDLCustomerQuery req);

    @Select("select * from v_kdl_custlist where ncts>=#{ncts}")
    List<KDLCustomer> GetNCCustomerList(String ncts);

    @Select("select isnull(max(convert(varchar(20),ncts,120)),'') from kdl_customer")
    String GetMaxNCTS();


    @Select("select * from kdl_customer_log where customercode=#{customercode} order by ncts desc")
    List<KDLCustomerLog> GetNCCustomerLogList(String customercode);

    @Select("select customername from  kdl_customer where customercode = '${customername}'")
    String getNameByCode(String customername);

    @Select("select distinct kdl_area_name from kdl_area_map order by kdl_area_name")
    List<String> getRegionList();

    @Select("select distinct qcusername from kdl_customer order by qcusername")
    List<String> getQCUserList();
}
